package com.zrh.jsd;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;

import java.net.InetAddress;
import java.net.UnknownHostException;

@Slf4j
@SpringBootApplication
public class JsdApplication {
    public static void main(String[] args) throws UnknownHostException {
        ConfigurableApplicationContext context = SpringApplication.run(JsdApplication.class, args);
        Environment env = context.getEnvironment();
        String ip = InetAddress.getLocalHost().getHostAddress();
        String port = env.getProperty("server.port");
        String swaggerPath = env.getProperty("knife4j.path");

        log.trace("swagger文档：" + "http://" + ip + ":" + port + swaggerPath);
        log.debug("swagger文档：" + "http://" + ip + ":" + port + swaggerPath);
        log.info("swagger文档：" + "http://" + ip + ":" + port + swaggerPath);
        log.warn("swagger文档：" + "http://" + ip + ":" + port + swaggerPath);
        log.error("swagger文档：" + "http://" + ip + ":" + port + swaggerPath);

    }
}
